package com.mkh.st.admin.service.impl;//package com.mkh.st.admin.service.impl;
//
//
//import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
//import com.baomidou.mybatisplus.core.toolkit.Wrappers;
//import com.mkh.st.admin.api.entity.SysUser;
//import com.mkh.st.admin.mapper.SysUserMapper;
//import com.mkh.st.admin.service.MiniloginService;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.boot.autoconfigure.dlock.annotation.Dlock;
//import org.springframework.stereotype.Service;
//
///**
// * @author tsf
// * @date 2021/7/5 13:33
// * <p>
// * TODO
// */
//@Service
//public class MiniloginServiceImpl implements MiniloginService {
//
//	@Autowired
//	private SysUserMapper sysUserMapper;
//
//	@Dlock(keys = {"#sysUser.miniOpenid"})
//	@Override
//	public Boolean addUser(SysUser sysUser) {
//		LambdaQueryWrapper<SysUser> q= Wrappers.lambdaQuery();
//		q.eq(SysUser::getMiniOpenid,sysUser.getMiniOpenid());
//		SysUser usere = sysUserMapper.selectOne(q);
//		if (usere ==null)
//		{
//			sysUserMapper.insert(sysUser);
//			SysUser updteUser = new SysUser();
//			updteUser.setUserId(sysUser.getUserId());
//			updteUser.setUsername(sysUser.getUserId()+"");
//			sysUserMapper.updateById(updteUser);
//		}
//		return Boolean.TRUE;
//	}
//}
